<ion-header>
    <ion-toolbar>
        <ion-title>学生信息</ion-title>
        <ion-buttons slot="end">
            <ion-button (click)="doClose()">
                <ion-icon slot="icon-only" name="close" color="danger"></ion-icon>
            </ion-button>
        </ion-buttons>
    </ion-toolbar>
</ion-header>

<ion-content>
    <ion-card>
        <ion-item>
            <ion-label> 学号：</ion-label>
            <ion-input [(ngModel)]="student.number" name='number' id="number" required #number="ngModel" placeholder="必填">
            </ion-input>
            <div *ngIf="number.invalid && (number.dirty || number.touched)" class="alert-danger">
                <div *ngIf="number.errors.required">
                    必填
                </div>
            </div>
        </ion-item>
        <ion-item>
            <ion-label> 姓名：</ion-label>
            <ion-input [(ngModel)]="student.name" name='name' id="name" required #name="ngModel" placeholder="必填"></ion-input>
            <div *ngIf="name.invalid && (name.dirty || name.touched)" class="alert-danger">
                <div *ngIf="name.errors.required">
                    必填
                </div>
            </div>
        </ion-item>
        <ion-item>
            <ion-label> 学院/系：</ion-label>
            <ion-input type="text" [(ngModel)]="student.college"> </ion-input>
        </ion-item>
        <ion-item>
            <ion-label> 班级：</ion-label>
            <ion-input type="text" [(ngModel)]="student.class"> </ion-input>
        </ion-item>
        <ion-item>
            <ion-label>性别：</ion-label>
            <ion-select slot="end" [(ngModel)]="student.gender">
                <ion-select-option *ngFor="let item of student.genderList" [value]="item.id">
                    {{item.value}}</ion-select-option>
            </ion-select>
        </ion-item>
        <ion-item>
            <ion-label> 电话：</ion-label>
            <ion-input type="text" [(ngModel)]="student.phone"> </ion-input>
        </ion-item>
        <br>
    </ion-card>
    <ion-button class="submit_btn" expand="full" (click)="submitInfo()">提交</ion-button>
</ion-content>